local ui = {}
local _V = function(...) return SL:GetMetaValue(...) end
local FUNCQUEUE = {}
local TAGOBJ = {}

function ui.init(parent, __data__, __update__)
	if __update__ then return ui.update(__data__) end
	-- Create ViewCelestialTome
	local ViewCelestialTome = GUI:Layout_Create(parent, "ViewCelestialTome", 0, 0, 1136, 640, false)
	GUI:setChineseName(ViewCelestialTome, "ViewCelestialTome")
	GUI:setAnchorPoint(ViewCelestialTome, 0.50, 0.50)
	GUI:setTouchEnabled(ViewCelestialTome, true)
	GUI:setTag(ViewCelestialTome, -1)

	-- Create ImageViewBG
	local ImageViewBG = GUI:Image_Create(ViewCelestialTome, "ImageViewBG", 568, 320, "res/peng_cheng/view_celestial_tome/bg_celestial_tome.png")
	GUI:setAnchorPoint(ImageViewBG, 0.50, 0.50)
	GUI:setTouchEnabled(ImageViewBG, true)
	GUI:setTag(ImageViewBG, -1)

	-- Create text_cultivation_points_1
	local text_cultivation_points_1 = GUI:Text_Create(ViewCelestialTome, "text_cultivation_points_1", 578, 285, 14, "#c70000", [[90]])
	GUI:Text_enableOutline(text_cultivation_points_1, "#000000", 1)
	GUI:setAnchorPoint(text_cultivation_points_1, 1.00, 0.00)
	GUI:setTouchEnabled(text_cultivation_points_1, false)
	GUI:setTag(text_cultivation_points_1, 0)

	-- Create text_cultivation_points_2
	local text_cultivation_points_2 = GUI:Text_Create(ViewCelestialTome, "text_cultivation_points_2", 584, 285, 14, "#ffffff", [[/]])
	GUI:Text_enableOutline(text_cultivation_points_2, "#000000", 1)
	GUI:setAnchorPoint(text_cultivation_points_2, 0.50, 0.00)
	GUI:setTouchEnabled(text_cultivation_points_2, false)
	GUI:setTag(text_cultivation_points_2, 0)

	-- Create text_cultivation_points_3
	local text_cultivation_points_3 = GUI:Text_Create(ViewCelestialTome, "text_cultivation_points_3", 590, 285, 14, "#00cd00", [[100]])
	GUI:Text_enableOutline(text_cultivation_points_3, "#000000", 1)
	GUI:setAnchorPoint(text_cultivation_points_3, 0.00, 0.00)
	GUI:setTouchEnabled(text_cultivation_points_3, false)
	GUI:setTag(text_cultivation_points_3, 0)

	-- Create text_gold_1
	local text_gold_1 = GUI:Text_Create(ViewCelestialTome, "text_gold_1", 538, 252, 14, "#c70000", [[90]])
	GUI:Text_enableOutline(text_gold_1, "#000000", 1)
	GUI:setAnchorPoint(text_gold_1, 1.00, 0.00)
	GUI:setTouchEnabled(text_gold_1, false)
	GUI:setTag(text_gold_1, 0)

	-- Create text_gold_2
	local text_gold_2 = GUI:Text_Create(ViewCelestialTome, "text_gold_2", 544, 252, 14, "#ffffff", [[/]])
	GUI:Text_enableOutline(text_gold_2, "#000000", 1)
	GUI:setAnchorPoint(text_gold_2, 0.50, 0.00)
	GUI:setTouchEnabled(text_gold_2, false)
	GUI:setTag(text_gold_2, 0)

	-- Create text_gold_3
	local text_gold_3 = GUI:Text_Create(ViewCelestialTome, "text_gold_3", 550, 252, 14, "#00cd00", [[100]])
	GUI:Text_enableOutline(text_gold_3, "#000000", 1)
	GUI:setAnchorPoint(text_gold_3, 0.00, 0.00)
	GUI:setTouchEnabled(text_gold_3, false)
	GUI:setTag(text_gold_3, 0)

	-- Create text_ingot_1
	local text_ingot_1 = GUI:Text_Create(ViewCelestialTome, "text_ingot_1", 734, 255, 14, "#c70000", [[90]])
	GUI:Text_enableOutline(text_ingot_1, "#000000", 1)
	GUI:setAnchorPoint(text_ingot_1, 1.00, 0.00)
	GUI:setTouchEnabled(text_ingot_1, false)
	GUI:setTag(text_ingot_1, 0)

	-- Create text_ingot_2
	local text_ingot_2 = GUI:Text_Create(ViewCelestialTome, "text_ingot_2", 740, 255, 14, "#ffffff", [[/]])
	GUI:Text_enableOutline(text_ingot_2, "#000000", 1)
	GUI:setAnchorPoint(text_ingot_2, 0.50, 0.00)
	GUI:setTouchEnabled(text_ingot_2, false)
	GUI:setTag(text_ingot_2, 0)

	-- Create text_ingot_3
	local text_ingot_3 = GUI:Text_Create(ViewCelestialTome, "text_ingot_3", 746, 255, 14, "#00cd00", [[100]])
	GUI:Text_enableOutline(text_ingot_3, "#000000", 1)
	GUI:setAnchorPoint(text_ingot_3, 0.00, 0.00)
	GUI:setTouchEnabled(text_ingot_3, false)
	GUI:setTag(text_ingot_3, 0)

	-- Create EquipShowCelestialTome
	local EquipShowCelestialTome = GUI:EquipShow_Create(ViewCelestialTome, "EquipShowCelestialTome", 534, 335, 12, false, {bgVisible = false, doubleTakeOff = false, look = true, movable = false, starLv = false, lookPlayer = false, showModelEffect = false, noMouseTips=false})
	GUI:EquipShow_setAutoUpdate(EquipShowCelestialTome)
	GUI:setAnchorPoint(EquipShowCelestialTome, 0.00, 0.00)
	GUI:setTouchEnabled(EquipShowCelestialTome, false)
	GUI:setTag(EquipShowCelestialTome, 0)

	-- Create text_main_1
	local text_main_1 = GUI:Text_Create(ViewCelestialTome, "text_main_1", 566, 213, 14, "#006b00", [[攻击]])
	GUI:Text_enableOutline(text_main_1, "#000000", 1)
	GUI:setAnchorPoint(text_main_1, 1.00, 0.00)
	GUI:setTouchEnabled(text_main_1, false)
	GUI:setTag(text_main_1, 0)

	-- Create text_main_2
	local text_main_2 = GUI:Text_Create(ViewCelestialTome, "text_main_2", 567, 213, 14, "#006b00", [[10-15]])
	GUI:Text_enableOutline(text_main_2, "#000000", 1)
	GUI:setAnchorPoint(text_main_2, 0.00, 0.00)
	GUI:setTouchEnabled(text_main_2, false)
	GUI:setTag(text_main_2, 0)

	-- Create node_secondary_1
	local node_secondary_1 = GUI:Node_Create(ViewCelestialTome, "node_secondary_1", 538, 171)
	GUI:setTag(node_secondary_1, 0)

	-- Create node_secondary_2
	local node_secondary_2 = GUI:Node_Create(ViewCelestialTome, "node_secondary_2", 538, 153)
	GUI:setTag(node_secondary_2, 0)

	-- Create node_secondary_3
	local node_secondary_3 = GUI:Node_Create(ViewCelestialTome, "node_secondary_3", 538, 162)
	GUI:setTag(node_secondary_3, 0)

	-- Create ImageViewReset
	local ImageViewReset = GUI:Image_Create(ViewCelestialTome, "ImageViewReset", 563, 117, "res/peng_cheng/view_celestial_tome/btn_reset_tome.png")
	GUI:setAnchorPoint(ImageViewReset, 0.50, 0.50)
	GUI:setTouchEnabled(ImageViewReset, true)
	GUI:setTag(ImageViewReset, -1)

	-- Create ButtonClose
	local ButtonClose = GUI:Button_Create(ViewCelestialTome, "ButtonClose", 962, 520, "res/public/1900000510.png")
	GUI:Button_loadTexturePressed(ButtonClose, "res/public/1900000511.png")
	GUI:setContentSize(ButtonClose, 26, 42)
	GUI:setIgnoreContentAdaptWithSize(ButtonClose, false)
	GUI:Button_setTitleText(ButtonClose, [[]])
	GUI:Button_setTitleColor(ButtonClose, "#ffffff")
	GUI:Button_setTitleFontSize(ButtonClose, 16)
	GUI:Button_titleEnableOutline(ButtonClose, "#000000", 1)
	GUI:setAnchorPoint(ButtonClose, 0.00, 0.00)
	GUI:setTouchEnabled(ButtonClose, true)
	GUI:setTag(ButtonClose, -1)

	ui.update(__data__)
	return ViewCelestialTome
end

function ui.update(data)
	for _, func in pairs(FUNCQUEUE) do
		if func then func(data) end
	end
end

return ui
